﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.Text;
using NyBio.DB;
using NyBio.Model;

namespace NyBio.Ctrl
{
    public class UserCtrl
    {
        private UserDB userDB;

        public UserCtrl()
        {
            userDB = new UserDB();
        }

        public void insertUser(User user)
        {
            userDB.insertUser(user);
        }

        public void removeUser(int id)
        {
            userDB.removeUser(id);
        }

        public void updateUser(User user)
        {
            userDB.updateUser(user);
        }

        public User getUser(int id)
        {
            return userDB.getUserById(id);
        }

        public List<User> getUsers()
        {
            return userDB.getUsers();
        }

        public User getUser(string username)
        {
            return userDB.getUserByUsername(username);
        }

        public List<User> getMemberSearch(string name)
        {
            return userDB.getMemberSearch(name);
        }
    }

}